$(function() {
    $('.js-add-book').on('click', function(e) {
        e.preventDefault();
        $('.js-add-book-form').dialog({
            title: 'Add book',
            modal: true
        });
    });

    $('.choose-author,.choose-book-field').on('click', function(e){
        e.preventDefault();
        $('.create-book-field').hide();
        $('.choose-book-field').show();
        $('.choose-author').css('color','#ffa500');
        $('.create-author').css('color','#333');
    });

    $('.create-author,.create-book-field').on('click', function(e){
        e.preventDefault();
        $('.create-book-field').show();
        $('.choose-book-field').hide();
        $('.choose-author').css('color','#333');
        $('.create-author').css('color','#ffa500');
    });
});